﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace LuanVanProject
{
    /// <summary>
    /// Interaction logic for NewNoteForm.xaml
    /// </summary>
    public partial class NewNoteForm : Window
    {
        static NewNoteForm instance = null;
        public string returnNodeName=null;
        public int idResource=-1;
        public static NewNoteForm Instance
        {
            get { return NewNoteForm.instance; }
            set { NewNoteForm.instance = value; }
        }
        public NewNoteForm()
        {
            InitializeComponent();
        }
        public NewNoteForm(BitmapSource img)
        {
            InitializeComponent();
            this.ImageSample.Source = img;
        }
        static public NewNoteForm GetInstance()
        {
            if (instance == null)
            {
                instance = new NewNoteForm();    
            }
                return instance;
        }

        private void Window_Closed(object sender, EventArgs e)
        {
            instance = null;
        }

        private void cancelButton_Click(object sender, RoutedEventArgs e)
        {

            DialogResult = false;
            this.Close();
        }

        private void OKbutton_Click(object sender, RoutedEventArgs e)
        {
            if (textBox1.Text == "")
            { 
            MessageBox.Show("Please enter idea");
            }
            else
            {

                returnNodeName = textBox1.Text;
                DialogResult = true;
            this.Close();
            }
        }
    }
}
